import 'dart:math';

import 'bean/AreaBean.dart';
import 'bean/AreaBean.dart';
import 'bean/AreaBean.dart';
import 'bean/AreaDeviceBean.dart';
import 'bean/GetLineAndHotUserTreeVoBean.dart';
import 'bean/ProjectBean.dart';
import 'bean/hotuserinfobean.dart';
import 'bean/latandlng.dart';
import 'bean/loginbean.dart';
import 'bean/userInfoList.dart';
import 'bean/xunjian/tasklistbean.dart';

class MyApplication{
  static loginbean loginuserinfo;
  static hotuserinfobean hotuserbean;
  static GetLineAndHotUserTreeVoBean hotuserbean2;
  static Map mapRoadChoice3 = new Map();


  static userInfoList alluserlist;
  static double latitude;
  static double longitude;
  static userinfo changedidongfabean;
  static Taskbean nowtaskbean;
  static String locationdetail= "";
  static Area areaBean;
  static Map areaDeviceBean;
  static Map areaDeviceBean2;
  static var inspacterId;
  static var areaId;
  static var deviceId;
  static ProjectBean projectBean;
  static  List<FocusHotUserVos> focusHotUserVos = new List();
  static  List<FocusHotUserVos> focusHotUserVos2 = new List();

  static List<FocusHotUserVos> getUserList(String name){
    focusHotUserVos.clear();
    for(int i = 0;i<hotuserbean.lineHotUserInfoTotalVos.length;i++){
      if(hotuserbean.lineHotUserInfoTotalVos[i].focusHotUserVos.length>0){
        hotuserbean.lineHotUserInfoTotalVos[i].focusHotUserVos[0].type=1;
      }
      for(int j = 0;j<hotuserbean.lineHotUserInfoTotalVos[i].focusHotUserVos.length;j++){
        if(hotuserbean.lineHotUserInfoTotalVos[i].focusHotUserVos[j].fullName.contains(name)){
          focusHotUserVos.add(hotuserbean.lineHotUserInfoTotalVos[i].focusHotUserVos[j]);
        }
      }
    }
    return focusHotUserVos;
  }


//百度坐标转高德（传入经度、纬度）
  static Coordinate bd_decrypt() {
    var X_PI = pi * 3000.0 / 180.0;
    var x = longitude - 0.0065;
    var y = latitude - 0.006;
    var z = sqrt(x * x + y * y) - 0.00002 * sin(y * X_PI);
    var theta = atan2(y, x) - 0.000003 * cos(x * X_PI);
    var gg_lng = z * cos(theta);
    var gg_lat = z * sin(theta);
    return new Coordinate(gg_lat, gg_lng);
  }



}